<h2>Add Products</h2>
<p id="notice"><%= notice %></p>

<% if @product.variants.empty? %>
  Sorry This product has no variants
<% else %>
  <%= form_tag admin_shopping_product_path(@product), method: 'put' do %>
    <% @product.variants.each_with_index do |variant, i| %>
      <div class='panel callout product_admin_panel'>
        <ul  id='variant-<%= i %>'
              class='<%= cycle("odd", "even") %> clear  clearfix panel callout radius' style='margin-bottom:20px;'>
          <li id='' class='six large-6 columns'>
            <%#= raw variant.display_property_details %>
            <% variant.variant_properties.each do |vp| %>
              <label><%= vp.property.display_name %></label> <%= vp.description %><br/>
            <% end %>
            <b><%= number_to_currency( variant.price ) %></b>
          </li>
          <li class='four large-4 columns'>
            Qty in Stock: <%= variant.display_stock_status %>(<%= variant.quantity_available %>)
          </li>
          <li id='variant-qty-<%= i %>' class='two large-2 columns' style='diplay:inline-block;'>
            Quantity: <%= text_field_tag("variant[#{ variant.id }]", nil, :class => 'one large-1', :style => 'width:50px;') %>
          </li>

        </ul>
      </div>
    <% end %>

    <%= submit_tag 'Add Items' %>
  <% end %>
<% end %>

<%= link_to 'Back', admin_shopping_products_path %>
